*,
*::after,
*::before {
  box-sizing: border-box;
  padding: 0;
  border: 0;
  margin: 0;
  vertical-align: baseline;
  font: inherit;
  font-size: 100%;
}

html {
  &[data-theme='light'] {
    --bg: #e4ecfa;
  }

  &[data-theme='dark'] {
    --bg: #2f3545;
  }

  &[data-theme='blue'] {
    --bg: linear-gradient(135deg, rgb(144 85 255), rgb(19 226 218));
  }

  &[data-theme='green'] {
    --bg: linear-gradient(135deg, rgb(214 255 127), rgb(0 179 204));
  }

  body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100vh;
    background: var(--bg);
    font-size: 14px;
    font-family: Arial, Helvetica, sans-serif;
    transition: background 0.5s ease-in-out;

    .container {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      padding: 30px;
      border-radius: 10px;
      background: rgb(255 255 255 / 45%);
      backdrop-filter: blur(5px);

      h1 {
        margin-bottom: 20px;
        font-size: 32px;
      }

      ul {
        &.list {
          display: flex;
          list-style: none;
          margin-bottom: 30px;

          > li {
            display: flex;
            margin: 0 10px;

            label {
              display: flex;
              align-items: center;
              margin-left: 5px;
              cursor: pointer;
            }
          }
        }
      }

      #checkbox {
        display: none;

        &:checked {
          & + .toggle {
            background: linear-gradient(to bottom, #036daf, #003d63);

            &::before {
              transform: translateX(280%);
            }

            &::after {
              transform: translateX(480%);
            }

            & .mountains {
              background-color: #05021a;
              transform: translateY(100%);
            }
            & .sea {
              bottom: -210%;
              background-color: #05021a;
            }
            & .star {
              top: 20%;
              transform: rotate(10deg);
            }
          }
        }
      }
    }

    .toggle {
      position: relative;
      width: 200px;
      height: 80px;
      border-radius: 9999px;
      background: linear-gradient(to bottom, #6ec8ff, #1f73a7);
      box-shadow: 6px 6px 10px #0000003d;
      overflow: hidden;
      cursor: pointer;

      &::before,
      &::after {
        position: absolute;
        top: 10%;
        border-radius: 50%;
        transition: all 0.5s ease-in-out;
        content: '';
      }

      &::before {
        right: 30%;
        width: 40px;
        height: 40px;
        background-color: #ffd34d;
        box-shadow: 0 0 15px #fef95fc3;
      }

      &::after {
        left: -60%;
        width: 35px;
        height: 35px;
        background-color: #fff;
        box-shadow: 0 0 10px #fff8;
      }

      > .mountains {
        position: absolute;
        width: 100%;
        height: 100%;
        background-color: #1d7371;
        clip-path: polygon(0% 80%, 25% 50%, 40% 70%, 60% 35%, 65% 45%, 80% 20%, 100% 80%, 100% 100%, 0% 100%);
        transition: all 0.5s ease-in-out;
        z-index: 3;
      }

      > .cloud {
        position: absolute;
        top: 20%;
        left: 10%;
        width: 18px;
        height: 8px;
        border-radius: 9999px;
        background-color: rgb(255 255 255);
        filter: opacity(0.5);

        &::before {
          position: absolute;
          top: -50%;
          right: 50%;
          width: 10px;
          height: 10px;
          border-radius: 50%;
          background-color: rgb(255 255 255);
          transform: translateX(50%);
          content: '';
        }
      }

      > .sea {
        position: absolute;
        right: 50%;
        bottom: -500%;
        width: 300%;
        height: 200px;
        border-radius: 50%;
        background: linear-gradient(to bottom, #3f75cc, #06063b, #06063b, #06063b, #06063b);
        transform: translateX(50%);
        transition: all 0.5s ease-in-out;

        &::before {
          position: absolute;
          top: 2%;
          left: 43%;
          width: 15px;
          height: 25px;
          background-color: rgb(254 254 254 / 34%);
          filter: blur(5px);
          content: '';
        }
      }

      > .star {
        position: absolute;
        top: -50%;
        right: 15%;
        width: 2px;
        height: 2px;
        border-radius: 50%;
        background-color: #fff;
        transition: all 0.5s ease-in-out;
        filter: blur(0.8px);

        &::before,
        &::after {
          position: absolute;
          width: 100%;
          height: 100%;
          border-radius: 50%;
          background-color: #fff;
          transition: all 0.5s ease-in-out;
          content: '';
        }

        &::before {
          top: -50%;
          right: 20px;
        }

        &::after {
          top: 10px;
          right: -20px;
        }
      }
    }
  }
}
